package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    //动态条件查询
    List<ShoppingCart> list(ShoppingCart shoppingCart);


    void updateById(ShoppingCart shoppingCart);

    /**
     * 插入购物车数据
     * @param shoppingCart
     */

    void insert(ShoppingCart shoppingCart);

    @Delete("delete from SHOPPING_CART where USER_ID=#{userId}")
    void deleteByUserId(Long userId);

    void deleteOne(ShoppingCartDTO shoppingCartDTO);

    void subOne(ShoppingCartDTO shoppingCartDTO);

    ShoppingCart listOne(ShoppingCart shoppingCart);

    void insertBatch(ShoppingCart one);
}
